﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FundRaising.BLL;

namespace FundRaising.GUI
{
    public partial class EditAsso : System.Web.UI.Page
    {
      
        
        protected void Page_Load(object sender, EventArgs e)
        {
            GUI.EditRequest.first = true;
            GUI.EditRequest.first2 = true;
        }

        

        protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
        {
            //string AssoName = e.Values[0].ToString();
            //string DomainName = "לא מוגדר";
            //AssoDomainBLL BLL = new AssoDomainBLL();
            //BLL.InsertDefualt(DomainName, AssoName);
            Response.Redirect("EditAsso.aspx");
            DropDownList1.SelectedValue = e.Values[0].ToString(); 
            
            
        }

       

        

        protected void ListView1_ItemInserting(object sender, ListViewInsertEventArgs e)
        {
           
            ListView1.FindControl("DdlDomail");
            DropDownList ddl = new DropDownList();
            ddl = (DropDownList)e.Item.FindControl("DdlDomail");
            if (ddl != null)
                e.Values["DomainName"] = ((ddl.SelectedValue));
            BLL.AssoDomainBLL.Domain = ddl.SelectedValue;
            BLL.AssoDomainBLL.Asso = DropDownList1.SelectedValue;
        }



        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            BLL.AssoDomainBLL.Asso = DropDownList1.SelectedValue;
        }

        protected void ListView1_ItemUpdating(object sender, ListViewUpdateEventArgs e)
        {
            BLL.AssoDomainBLL.Asso = DropDownList1.SelectedValue;
        }

        protected void DetailsView1_ItemDeleted(object sender, DetailsViewDeletedEventArgs e)
        {
            
            Response.Redirect("EditAsso.aspx");
        }

        
            
            
            
        

        

        
    }
}
